package com.xcf.service.system.companyAndDepartment.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.service.system.companyAndDepartment.CompanyAndDepartmentService;
import com.xcf.util.PageData;
@Service
public class CompanyAndDepartmentServiceImpl implements CompanyAndDepartmentService{
	@Resource
	private DaoSupport dao;
	@Override
	public List<Map> findCompanyAndDepartmentInfo() throws Exception {
		
		return (List<Map>) dao.findForList("companyAndDepartment.findCompanyAndDepartmentInfo", null);
	}
	@Override
	public List<Map> findCompany() throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("companyAndDepartment.findCompanyInfo", null);
	}
	@Override
	public List<Map> findDepartment(String COMPANY_ID) throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("companyAndDepartment.findDepartmentInfo", COMPANY_ID);
	}
	@Override
	public void saveCompanyInfo(PageData pd) throws Exception {
		dao.save("companyAndDepartment.saveCompanyInfo", pd);
		
	}
	@Override
	public void saveDepartmentInfo(PageData pd) throws Exception {
		dao.save("companyAndDepartment.saveDepartmentInfo", pd);
		
	}
	@Override
	public List<Map> findDepartmentByParentId(String PARENT_DEPARTMENT_ID) throws Exception {
		
		return (List<Map>) dao.findForList("companyAndDepartment.findDepartmentByParentId", PARENT_DEPARTMENT_ID);
	}
	@Override
	public void deleteCompanyInfp(String COMPANY_ID) throws Exception {
		dao.delete("companyAndDepartment.deleteCompanyInfo", COMPANY_ID);
		
	}
	@Override
	public void deleteDepartmentInfo(String DEPARTMENT_ID) throws Exception {
		dao.delete("companyAndDepartment.deleteDepartmentInfo", DEPARTMENT_ID);
		
	}

}
